import ruleOpt from '@/biz/option/rule.js'
import dt from '@dt/dt'

let _this = null

function options(vm, isUpdate = false) {
  _this = vm
  return [
    [{
      title: '请佣单名称',
      key: 'commissionName',
      placeholder: '请输入请佣单名称',
      input: {},
      rules: [
        ruleOpt.required('请输入请佣单名称'),
        ruleOpt.max(20)
      ]
    }],
    [{
      title: '请佣月份',
      key: 'commissionMonth',
      placeholder: '请选择请佣月份',
      date: {
        type: 'month'
      },
      rules: [{
        required: true,
        message: '请选择请佣月份',
        trigger: 'blur'
      }]
    }],
    [{
      title: '结算类型',
      key: 'settlementType',
      placeholder: '请选择结算类型',
      disabled: isUpdate,
      col: 18,
      select: {
        options: dt.dictInfo().settlementType
      },
      rules: [{
        required: true,
        message: '请选择结算类型',
        trigger: 'blur'
      }]
    }]
  ]
}

export default {
  options
}
